]> git.r.bdr.sh - rbdr/super-polarity/blobdiff - Super Polarity/Widget.cs
Chubas's house sprint.
[rbdr/super-polarity] / Super Polarity / Widget.cs
index 65c3fd23d4f36bb01caabe5a264c71de78b4337c..ea92cfd7565fc148ad410643297b3534c72c7ae4 100644 (file)
@@ -2,14 +2,40 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
 
 namespace SuperPolarity
 {
     class Widget
     {
-        public IList<Widget> Children;
+        public List<Widget> Children;
         public Dictionary<string, List<Action<float>>> Listeners;
 
+        public Vector2 Position;
+        public SuperPolarity Game;
+
+        protected bool Active;
+
+        public Widget(SuperPolarity game, Vector2 position)
+        {
+            Game = game;
+            Position = position;
+            Active = false;
+            Children = new List<Widget>();
+            Listeners = new Dictionary<string, List<Action<float>>>();
+        }
+
+        public void Activate()
+        {
+            Active = true;
+        }
+
+        public void Deactivate()
+        {
+            Active = false;
+        }
+
         public virtual void AppendChild(Widget widget)
         {
             Children.Add(widget);
@@ -54,5 +80,13 @@ namespace SuperPolarity
                 method(value);
             }
         }
+
+        public virtual void Update(GameTime gameTime)
+        {
+        }
+
+        public virtual void Draw(SpriteBatch spriteBatch)
+        {
+        }
     }
 }